package com.th.mapper;

import com.th.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * @author ThreePure
 * @date 20/12/21 8:57
 * @description:TODO
 * @since 1.8
 */
public class UserMapperImpl implements UserMapper{

    //我们的所有操作，都用sqlSession来执行，在原来，现在使用SqlSessionTemplate；
    private SqlSessionTemplate sqlSessionTemplate;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSessionTemplate = sqlSession;
    }

    @Override
    public List<User> selectUserList() {
        UserMapper mapper = sqlSessionTemplate.getMapper(UserMapper.class);
        return mapper.selectUserList();
    }
}
